package com.cn.wanxi.test;

public class ArrayFor {
    public static void main(String[] args) {
        int[] arr = {23, 3, 43, 2, 3};
        int sum = 0;
        for (int i = 0; i < arr.length; i++) {
            if (i % 2 == 1) {
                sum += arr[i];
                System.out.println(arr[i]);
            }
        }
        System.out.println("和为：" + sum);
//        System.out.println(arr[0]);
//        System.out.println(arr[1]);
//        System.out.println(arr[2]);
//        System.out.println(arr[3]);
//        System.out.println(arr[4]);
    }
}
